<template>
  <a-card :bordered="false">

    <div class="table-page-search-wrapper">
      <a-form-model ref="form" :model="formData" layout="inline">
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item label="总体评价" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
              <a-select placeholder="总体评价" show-search allowClear v-model="formData.result" :disabled="allow">
                <a-select-option v-for="item in searchOptions" :key="item.value" :value="item.text">{{
                    item.text
                  }}</a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="24">
            <a-form-item label="用药合理性评价" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
              <j-checkbox
                v-model="formData.check"
                :options="jCheckboxOptions" :disabled="allow"
              />
            </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :span="12">
            <a-form-item label="总体备注" :labelCol="{ span: 5 }" :wrapperCol="{ span: 18, offset: 1 }">
              <a-input placeholder="请输入备注" v-model="formData.remark" :disabled="allow"></a-input>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form-model>
    </div>

  </a-card>
</template>

<script>
  import AList from 'ant-design-vue/es/list'
  import AListItem from 'ant-design-vue/es/list/Item'
  import JDictSelectTag from "@comp/dict/JDictSelectTag";
  import JInput from '@comp/jeecg/JInput'
  import JCheckbox from '@/components/jeecg/JCheckbox'
  import {httpAction, postActionparams2} from '@/api/manage'
  export default {
    name: "Article",
    components: {
      AList,
      AListItem,
      JDictSelectTag,
      JCheckbox,
      JInput
    },
    props:['DetailData'],
    data() {
      return {
        selectList: [],
        allow:false,
        selectedDepUsers: '',
        formData: {
        },
        searchOptions:[{
          text:"通过",
          value:"1"
        },{
          text:"不通过",
          value:"2"
        }],
        check: '',
        Detail:{},
        jCheckboxOptions: [
          {label: '适应症', value: '1'},
          {label: '围手术期用药时间（术前）', value: '2'},
          {label: '围手术期用药时间（术中超3h追加）', value: '3'},
          {label: '品种选择', value: '4'},
          {label: '剂量', value: '5'},
          {label: '频次', value: '6'},
          {label: '溶媒', value: '7'},
          {label: '用药疗程', value: '8'},{label: '更换品种', value: '9'},
          {label: '联合用药', value: '10'},
          {label: '其他情况', value: '11'},
        ],

      }
    },
    created() {
      if(this.DetailData.status === '0'){
        this.allow = false
      }else {
        this.formData.result = this.DetailData.result
        this.formData.remark = this.DetailData.remark
        this.formData.check = this.DetailData.check
        this.allow = true
      }
    },
    methods: {
      add(id) {
        let that = this
        var param = {
          check: this.formData.check,
          remark: this.formData.remark,
          result: this.formData.result,
          status: 1,
          id: id,
        }
        httpAction("/perioperative/update", param, "post")
          .then(res => {
            if (res.success) {

            } else {
            }
          })
      },
    }
  }
</script>

<style lang="less" scoped>
.ant-card-body .table-operator {
  margin-bottom: 18px;
}

.ant-table-tbody .ant-table-row td {
  padding-top: 15px;
  padding-bottom: 15px;
}

.anty-row-operator button {
  margin: 0 5px
}

.ant-btn-danger {
  background-color: #ffffff
}

.ant-modal-cust-warp {
  height: 100%
}

.ant-modal-cust-warp .ant-modal-body {
  height: calc(100% - 110px) !important;
  overflow-y: auto
}

.ant-modal-cust-warp .ant-modal-content {
  height: 90% !important;
  overflow-y: hidden
}
</style>